{% extends "base.html" %}

{% block body %}

<div class="edit">

    <form action="/{{blog_id}}/Edit" method="post" name="form">
        <input type="hidden" name="blog_id" value="{{blog_id}}">
        {% module xsrf_form_html() %}

        <input type="text" name="title" class="edit_title" placeholder="Title" value="{{ info.title if info else '' }}">

        <div class="date_and_tag edit_date_tags">
            <div id="date" onclick="display('tags');">
                {{locale.format_date(info.date,-480,full_format=True)}}
            </div>
            <div class="tags" id="tags" style="display: none;">
                {% if info%}
                {% for i in info.tags %}
                <a href="#" class="tag select_tag">#{{i.name}}#</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="hidden" name="tag" value="{{i.name}}">
                {% end %}
                {% end %}

                {% for i in tags %}
                <a href="#" class="tag" data-name="{{i.name}}" onclick="tag_check(this);">#{{i.name}}#</a>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                {% end %}
                <input type="text" name="new_tag" class="form-control" placeholder="Tags">
            </div>
        </div>
        <textarea name="content" rows="18" class="edit_content">
            {{ info.content if info else '' }}
        </textarea>
        <button type="submit" class="button">发布</button>

    </form>
</div>
{% end %}